package starter.actions.orangehrmlive;

/**
 * @ClassName MenuPageSteps
 * @Date 2024/11/2 12:07 08
 * @Author Jack Chen
 * @Description serenity-cucumber-auto-project-jack
 * @Version 1.0
 */
import net.serenitybdd.annotations.Step;
import org.junit.Assert;
import starter.pageobjects.orangehrmlive.TopbarPage;
import starter.pageobjects.orangehrmlive.NavbarPage;

public class NavbarPageSteps {
    NavbarPage navbarPage;

    TopbarPage topbarPage;

    @Step("verify search box shown in HRM menubar")
    public void verifySearchBoxShownInHRMMenubar() {
        Assert.assertTrue(navbarPage.checkSearchBoxShown());
    }

    @Step("check the {menu} displayed correct")
    public void checkSearchResultContainsMenu(String menu) {
        Assert.assertTrue(navbarPage.checkSearchMenuDisplayed(menu));
    }

    @Step("input {keyword} into menu search box")
    public void inputContextIntoMenuSearchBox(String keyword) {
        navbarPage.checkSearchBoxShown();
        navbarPage.inputSearchBox(keyword);
    }

    public void checkMenuDisplayed(String menuName) {
        Assert.assertTrue(navbarPage.checkMenuDisplayed(menuName));
    }

    public void userClickMenu(String menuName) {
        navbarPage.clickOnMenu(menuName);
    }

    public void checkPageDisplayed(String pageName) {
        Assert.assertTrue(topbarPage.checkPageDisplayed(pageName));
    }
}
